<template>
  <div class="situation">
    <!-- title威胁感知系统 -->
    <div class="situation-title"></div>
    <div class="situation-content">
      <!-- 内容-左 -->
      <div class="content-left">
        <!-- 饼状图（环形） -->
        <div class="content-box">
          <h1><span>▋</span>主机漏洞</h1>
          <Circular></Circular>
        </div>
        <!-- 柱状图 -->
        <div class="content-box">
          <h1><span>▋</span>威胁类型</h1>
          <Bar></Bar>
        </div>
        <!-- 表格图 -->
        <div class="content-box">
          <h1><span>▋</span>攻击事件</h1>
          <Table></Table>
        </div>
      </div>
      <!-- 内容-中 -->
      <div class="content-center">
        <div class="inp">
          <span class="text">威胁感知系统</span>
        </div>
        <div class="cont_foot"></div>
      </div>
      <!-- 内容-右 -->
      <div class="content-right">
        <div class="content-box bg box-one">
          <div class="box1">
            <h2>4</h2>
            <p>安全威胁数</p>
          </div>
          <div class="box1">
            <h2>9</h2>
            <p>违规阻断数</p>
          </div>
          <div class="box1">
            <h2>4</h2>
            <p>防护资产</p>
          </div>
        </div>
        <div class="content-box">
          <h1><span>▋</span>攻击源TOP5</h1>
          <Ber></Ber>
        </div>
        <div class="content-box">
          <h1><span>▋</span>攻击目标TOP6</h1>
          <Area></Area>
        </div>
      </div>
    </div>
    <!-- foot -->
    <div class="situation-footer"></div>
  </div>
</template>
<script>

import Circular from "@/components/Circular.vue"
import Bar from "@/components/Bar.vue"
import Ber from "@/components/Ber.vue"
import Area from "@/components/Area.vue"
import Table from "@/components/Table.vue"

export default {
  components:{
    Circular,
    Bar,
    Ber,
    Area,
    Table
  },
  data() {
    return {    
      stop: [
        {
          itme: "2021-06-07",
          leixing: "DDOS",
          gonji: "10.10.2.12",
          mudi: "10.10.2.26",
          fenxian: "高",
          fs: "阻断",
        },
        {
          itme: "2016-06-15",
          leixing: "僵尸网络",
          gonji: "192.168.1.100",
          mudi: "192.168.1.125",
          fenxian: "高",
          fs: "阻断",
        },
        {
          itme: "2021-07-24",
          leixing: "勒索病毒",
          gonji: "10.10.1.9",
          mudi: "10.10.2.6",
          fenxian: "高",
          fs: "阻断",
        },
        {
          itme: "2016-06-15",
          leixing: "僵尸网络",
          gonji: "192.168.1.100",
          mudi: "192.168.1.125",
          fenxian: "高",
          fs: "阻断",
        },
      ],
    };
  },

  watch: {
    $route: function (to) {
      if (to.path == "/situation") {
        this.bg_on = true;
      } else {
        this.bg_on = false;
      }
    },    
  },
};
</script>
<style lang="less" scoped >
.situation {
  width: 1200px;
  overflow: hidden;
  margin: 0 auto;
  .situation-title {
    width: 100%;
    height: 70px;
    background: url("@/assets/images/title.png") no-repeat 0 0 / contain;
  }
  .situation-footer {
    width: 100%;
    height: 85px;
    background: url("@/assets/images/foot.png") no-repeat 0 0 / contain;
    margin-bottom: 50px;
  }
  .situation-content {
    display: flex;
    justify-content: space-between;
    .content-left,.content-right {
      h1 {
        color: #ccc;
        font-size: 28px;
        vertical-align: middle;
        span{
          // width: 8px;
          // height: 28px;
          font-size: 28px;
          color: #08c573;
          vertical-align: top;
        }
      }
      .content-box {
        width: 390px;
        height: 210px;
        margin: 20px 0;
        box-sizing: border-box;
        padding: 10px;
      }
    }
    .content-center {
      user-select: none;
      display: flex;
      align-items: center;
      flex-direction: column;
      .inp {
        width: 395px;
        height: 126px;
        background: url("@/assets/images/kuang.png") no-repeat 100% 100% / cover;
        position: relative;
        border: 1px solid rgba(12, 99, 212, 0.664);
        margin-bottom: 10px;
        .text {
          width: 100%;
          height: 100%;
          display: inline-block;
          line-height: 126px;
          font-size: 28px;
          color: #74d1f5;
          text-align: center;
        }
        .frame {
          cursor: pointer;
          position: absolute;
          top: 10px;
          right: 10px;
          img {
            width: 20px;
            height: 20px;
          }
        }
      }
      .cont_foot {
        width: 390px;
        height: 600px;
        color: rgb(48, 46, 46);
        box-sizing: border-box;
        // padding: 36px 0 0 36px;
        position: relative;
        background: url("@/assets/images/center.png") no-repeat;
        background-size: 100% 100%;
        span {
          display: inline-block;
          width: 20px;
          height: 20px;
          color: #0d2a42;
          line-height: 20px;
          text-align: center;
          position: absolute;
          font-size: 12px;
          &:nth-child(1) {
            top: 168px;
            left: 64px;
          }
          &:nth-child(2) {
            top: 272px;
            left: 88px;
          }
          &:nth-child(3) {
            top: 133px;
            left: 130px;
          }
          &:nth-child(4) {
            top: 239px;
            left: 160px;
          }
          &:nth-child(5) {
            top: 102px;
            left: 198px;
          }
          &:nth-child(6) {
            top: 206px;
            left: 219px;
          }
        }
      }
    }
    .content-right {
      .box-one{
        display: flex;
        justify-content: space-around;
        align-items: center;
        h2{
          font-size: 36px;
          color: white;
          text-align: center;
        }
        p{
          color: #ccc;
        }
      }
    }
    .bg{
      background: url(@/assets/images/p1.png) no-repeat;
    }
  }
}
</style>
